package com.atguigu.yygh.hosp.mongotest;

import io.swagger.models.auth.In;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created with IntelliJ IDEA
 *
 * @Date: 2022/12/19 - 08:45
 * @Author: Hyoung
 * @Description:
 */
@Repository
public interface UserRepository extends MongoRepository<User, String> {

    // springData查询规范
    List<User> findByName(String name);


    List<User> findByNameLike(String name);

    List<User> findByNameAndAge(String name, Integer age);

    List<User> findByNameNotLikeOrderByNameDesc(String name, Integer min, Integer max);
}
